#ifndef GRAPH_H
#define GRAPH_H

#include <memory.h>
#include "Node.h"


class DFA {
public:
    shared_ptr<DFANode> startup_item_set;                    // 起始项集
    vector<shared_ptr<DFANode>> nodes;
    map<set<LR0Item>,int> items_map;    //用于记录set<LR0Item> 的，防止死循环，一直添加node

    DFA(NonTerminalSymbol *start_symbol);

    void build_DFA();

    void get_info(){
        for(auto ptr:nodes){
            ptr.get()->get_info();
        }
    }
    bool calcu_action(vector<TerminalSymbol*> &grammar_symbol_vct);
    void calcu_goto(vector<NonTerminalSymbol*> &grammar_symbol_vct);
};





#endif